import axios from '@/utils/request';
import { BASE_URL } from '@/api';

export const roleList = (params) => {
	return axios.get(`${BASE_URL}/role/list`, { params: params });
};

export const addRole = (params) => {
	return axios.post(`${BASE_URL}/role`, params);
};

export const editRole = (params) => {
	return axios.put(`${BASE_URL}/role`, params);
};

export const removeRole = (id) => {
	return axios.delete(`${BASE_URL}/role/${id}`);
};

export const roleMenuList = (params) => {
	return axios.get(`${BASE_URL}/role/menu`, { params: params });
};

export const rolePermissionList = (params) => {
	return axios.get(`${BASE_URL}/role/permission`, { params: params });
};

export const roleMenu = (params) => {
	return axios.put(`${BASE_URL}/role/menu`, {}, { params: params });
};

export const rolePermission = (params) => {
	return axios.put(`${BASE_URL}/role/permission`, {}, { params: params });
};
